﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Liger.Web.Common;
using Liger.Web.Common.Extensions;

namespace Liger.Web.UI
{
    public class DialogStringBuilder : UIComponentBuilderBase, IHideObjectMembers
    {
        private DialogString DialogString
        {
            get
            {
                return this.Component as DialogString;
            }
        }


        public DialogStringBuilder()
            : base(new DialogString())
        {

        }

        public DialogStringBuilder(DialogString DialogString)
            : base(DialogString)
        {

        }

        /// <summary>
        /// 设置属性
        /// </summary>
        /// <param name="property"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public DialogStringBuilder Set(string property, object value)
        {
            if (this.DialogString.Properties.ContainsKey(property))
            {
                this.DialogString.Properties[property] = value;
            }
            else
            {
                this.DialogString.Properties.Add(property, value);
            }
            return this;
        }

        /// <summary>
        /// 返回ligerDialogString的Manager
        /// </summary>
        /// <param name="manager">manager的对象名</param>
        /// <returns></returns>
        public DialogStringBuilder Manager(string manager)
        {
            this.DialogString.Manager = manager;
            return this;
        }


        public DialogStringBuilder TitleMessage(string value)
        {
            this.DialogString.TitleMessage = value;
            return this;
        }
        public DialogStringBuilder Ok(string value)
        {
            this.DialogString.Ok = value;
            return this;
        }
        public DialogStringBuilder Yes(string value)
        {
            this.DialogString.Yes = value;
            return this;
        }
        public DialogStringBuilder No(string value)
        {
            this.DialogString.No = value;
            return this;
        }
        public DialogStringBuilder Cancel(string value)
        {
            this.DialogString.Cancel = value;
            return this;
        }
        public DialogStringBuilder WaittingMessage(string value)
        {
            this.DialogString.WaittingMessage = value;
            return this;
        }
    }
}